package com.qianli.cashmama.trade.repo;

import com.fqgj.common.api.Page;
import com.qianli.cashmama.trade.common.enums.TaskTypeEnum;
import com.qianli.cashmama.trade.domain.model.TradeTaskCenter;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/22
 * Time: 下午4:18
 */
public interface TradeTaskCenterRepository {
    /**
     * @param tradeTaskCenter
     */
    Long store(TradeTaskCenter tradeTaskCenter);

    /**
     * 根据任务类型和page获取等待执行的任务列表
     *
     * @param typeEnum
     * @param page
     * @param retryCount
     * @return
     */
    List<TradeTaskCenter> selectWaitingListByPageAndType(TaskTypeEnum typeEnum, Page page, Integer retryCount);

    /**
     * @param tradeTaskCenter
     */
    void update(TradeTaskCenter tradeTaskCenter);

    List<TradeTaskCenter> selectTradeTaskList(String tradeNo, TaskTypeEnum taskTypeEnum);

    String getTaskRecord(Long taskId);

    void updateTaskRecord(Long taskId, String msg);

    void delete(TradeTaskCenter tradeTaskCenter);
}
